import request from '@/router/axios';

// 获取列表
export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-purchase/modeltinfo/moldList',
    method: 'get',
    params: {
      ...params,
      current,
      size,
    }
  })
}
// 获取物料组
export const getMaterialGroupNoList = () => {
  return request({
    url: '/api/blade-purchase/materialgroupinfo/materialGroupNoList',
    method: 'get',
    params: {}
  })
}

// 报价供应商列表
export const quotationSypplierList = (params) => {
  return request({
    url: '/api/blade-purchase/modeltinfo/quotationSypplierList',
    method: 'get',
    params: {
      ...params
    }
  })
}

// 物料列表
export const materialList = (params) => {
  return request({
    url: '/api/blade-purchase/modeltinfo/materialList',
    method: 'get',
    params: {
      ...params
    }
  })
}

// 模具清单信息
export const modeltList = (params) => {
  return request({
    url: '/api/blade-purchase/modeltinfo/modeltList',
    method: 'get',
    params: {
      ...params
    }
  })
}

// 保存模具清单
export const save = (data) => {
  return request({
    url: '/api/blade-purchase/modeltinfo/save',
    method: 'post',
    data
  })
}

// 提交模具清单
export const submit = (moldListNo,state) => {
  return request({
    url: '/api/blade-purchase/modeltinfo/submit',
    method: 'get',
    params: {
      state,
      moldListNo
    }
  })
}

// 逻辑删除
export const remove = (moldListNo) => {
  return request({
    url: '/api/blade-purchase/modeltinfo/remove',
    method: 'post',
    params: {
      moldListNo
    }
  })
}

// 详情
export const detail = (moldListNo) => {
  return request({
    url: '/api/blade-purchase/modeltinfo/detail',
    method: 'get',
    params: {
      moldListNo
    }
  })
}

// 上传附件
export const upload = (data) => {
  return request({
    url: '/api/blade-purchase/modeltinfo/upload',
    method: 'post',
    data
  })
}
